<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <jsp:include page="../../base.jsp"></jsp:include>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户编辑</title>
<script type="text/javascript">
	function updateUser() {
		if(!$('#editForm').form('validate')) {
			return;
		}
		$('#editForm').submit();
		window.parent.closeEditWindow();
	}
</script>
</head>
<body>
	<form action="/S3H3L3/userInfo/updateAndSaveUser.do" method="post" id="editForm">
	<input type="hidden" value="${userInfo.id }" name="id" id="id">
	<table>
		<tr>
			<td colspan="2" align="center"><h1>编辑用户</h1></td>
		</tr>
		<tr>
			<td align="right"><label>用户名:</label></td>
			<td>
				<label>
					<input id="userName" name="userName" value="${userInfo.userName }" width="200px;" class="easyui-validatebox" onchange="checkUserIsExist()" required="true" readonly="readonly"/>
				</label>
			</td>
		</tr>
		<tr>
			<td align="right"><label>密码:</label></td>
			<td>
				<label>
					<input id="password" name="password" value="${userInfo.password }" width="200px;" class="easyui-validatebox" onchange="checkUserIsExist()" required="true"/>
				</label>
			</td>
		</tr>
		<tr>
			<td align="right"><label>性别:</label></td>
			<td>
				<c:if test="${userInfo.sex == 1}">
					<input id="sex1" name="sex" type="radio" value="1" checked="checked"/><label for="sex1">男</label>
					<input id="sex2" name="sex" type="radio" value="0"/><label for="sex2">女</label>
				</c:if>
				<c:if test="${userInfo.sex == 0}">
					<input id="sex1" name="sex" type="radio" value="1"/><label for="sex1">男</label>
					<input id="sex2" name="sex" type="radio" value="0" checked="checked"/><label for="sex2">女</label>
				</c:if>
			</td>
		</tr>
		<tr>
			<td align="right"><label>年龄:</label></td>
			<td><label><input id="age" name="age" value="${userInfo.age }" width="200px;" class="easyui-validatebox" /></label></td>
		</tr>
		<tr>
			<td align="right"><label>角色:</label></td>
			<td>
				<input id="role1" name="role" type="radio" value="2" checked="checked"/><label for="role1">普通用户</label><br />
				<input id="role2" name="role" type="radio" value="3"/><label for="role2">用户管理员</label><br />
				<input id="role3" name="role" type="radio" value="4"/><label for="role3">新闻管理员</label>
			</td>
		</tr>
		<tr>
			<td align="right"><label>地址:</label></td>
			<td><label><input id="address" name="address" value="${userInfo.address }" width="200px;" class="easyui-validatebox" /></label></td>
		</tr>
		<tr>
			<td></td>
			<td>
				<a href="#" class="easyui-linkbutton" onclick="updateUser();">更新</a>
				<a href="#" class="easyui-linkbutton" onclick="reset();">重置</a>
			</td>
		</tr>
	</table>
	</form>
</body>
</html>